#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QList>
#include "downloadhelper.h"
#include <QPair>
#include <QProcess>

namespace Ui {
class MainWindow;
}
bool IsVesUpdata(QString v1, QString v2);// 本地版本 > 下载文件版本 ? true : false
bool TempFunc(QList<QPair<QString, QUrl>>::iterator a, QList<QPair<QString, QUrl>>::iterator b);
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
signals:
    void SendUpdataOver();

private slots:
    void on_StartGame_clicked();
    void GetMessageFileDownEnd();
    void GetUpdataOver();

private:
    Ui::MainWindow *ui;
    QList<QPair<QString, QUrl>> UpdataList;
    downloadHelper *fileManager;
    bool firstReadLocalUpdataFile;
    QString vers;//current version
    QStringList listFileName;
    QProcess myProcess;

    void LocalReadUpdata();
    void downloadProcess();

    void init();
    bool WriteInformation(QString fileName, QStringList listData);

};

#endif // MAINWINDOW_H
